﻿using System.Collections.ObjectModel;
using System.Windows;

namespace Labthink.PCSoft.UniversalHost4
{
    public class PagingVM<T> : DependencyObject
    {
        public static readonly DependencyProperty PageIndexProperty =
            DependencyProperty.Register(nameof(PageIndex), typeof(int), typeof(PagingVM<T>));

        public static readonly DependencyProperty NumberOfPagesProperty =
            DependencyProperty.Register(nameof(NumberOfPages), typeof(int), typeof(PagingVM<T>));

        public int PageIndex
        {
            get => int.Parse(GetValue(PageIndexProperty).ToString());
            set => SetValue(PageIndexProperty, value);
        }

        public int NumberOfPages
        {
            get => int.Parse(GetValue(NumberOfPagesProperty).ToString());
            set => SetValue(NumberOfPagesProperty, value);
        }

        public ObservableCollection<T> Collection { get; set; }

        public PagingVM(ObservableCollection<T> collection)
        {
            Collection = collection;
        }
    }
}

